Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/model/src/commonMain/kotlin/org/meshtastic/core/model/WaypointLock.kt 01cd54907d62cd90913d3d071b6bc240cae365ef (01cd5490) Text, 1.97 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model

Tff7b72import T7ee787org.meshtastic.proto.Waypoint

T8b949e/**
* Whether this waypoint is locked to a single node. A locked waypoint (`locked_to != 0`) may only be edited or removed
* mesh-wide by the node it is locked to; an unlocked waypoint (`locked_to == 0`) is editable by anyone.
*/
Tff7b72val Te6edf3WaypointTb4b4b4.Te6edf3isLockedTb4b4b4: Tffa657Boolean
Tff7b72getTb4b4b4(Tb4b4b4) Tff7b72= Te6edf3locked_to Tff7b72!Tff7b72= T79c0ff0

T8b949e/**
* Whether [nodeNum] is permitted to edit this waypoint or broadcast a change/removal of it: true when the waypoint is
* unlocked, or locked to exactly [nodeNum]. A null [nodeNum] (our own identity not yet known) can only modify unlocked
* waypoints.
*
* Single source of truth for the `locked_to` permission check. Callers pass the identity being checked:
* - map edit/delete gates pass our own node number, so the creator can always manage a waypoint locked to themselves;
* - the inbound-packet validator passes the packet's sender, so a locked waypoint is only accepted from its owner.
*
* The lock owner must be a real node number. Writing a placeholder (e.g. `1`) would lock a waypoint to a phantom node
* that no real device can match, silently blocking even the creator — see issue #6343.
*/
Tff7b72fun Te6edf3WaypointTb4b4b4.Td2a8ffisModifiableByTb4b4b4(Te6edf3nodeNumTb4b4b4: Tffa657Int?Tb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72= Te6edf3locked_to Tff7b72=Tff7b72= T79c0ff0 Tff7b72|Tff7b72| Te6edf3locked_to Tff7b72=Tff7b72= Te6edf3nodeNum

Served by rngit 1.5.0 - Generated in 0.04s